package com.surfacing.rcp.client.providers;

import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;

import com.surfacing.rcp.model.entity.Journal;

public class JournalViewFilter extends ViewerFilter {
	// the criteria to filter
	private int protokollnummer;

	/**
	 * Default class constructor for the address filter.
	 * 
	 * @param value
	 *            the street or the city to filter
	 */
	public JournalViewFilter(int protokollnummer) {
		this.protokollnummer = protokollnummer;
	}

	/**
	 * Returns whether or not the object should be filtered or not.
	 * 
	 * @param viewer
	 *            the viewer
	 * @param parentElement
	 *            the parent element
	 * @param element
	 *            the element to check
	 */
	@Override
	public boolean select(Viewer arg0, Object parentElement, Object element) {
		// cast to a journal
		Journal journal = (Journal) element;

		// if (location != null & !location.trim().isEmpty()) {
		// if (!journal.getPlanedLocation().getLocationName()
		// .contains(location)
		// & !journal.getPlanedLocation().getLocationName()
		// .startsWith(location))
		// return false;
		// }
		// nothing matched
		return true;
	}
}
